<?php echo $this->element('user_menu');?>      
<?php echo $this->element('banner',array('category' => 'search'));?>
<div id="body_container" class="group">
	    <div id="left_container">
<?php echo $this->element('advertisement',array('category' => 'search'));?>
<?php echo $this->element('left_bar');?>
<?php
	echo $this->Form->create();
	echo $this->Form->input('JobProvider.job_location_id', array('type' => 'hidden'));
	echo $this->Form->input('JobProvider.job_location_id', array('empty'=>true, 'id' => 'parentJobLocation', 'name' => 'parent'));
	echo $this->Form->input('JobDetail.salary', array('help' => 'Minimum Salary'));
	echo '<label>&nbsp;</label>';
	echo '<fieldset>';
	echo '<legend>Categories</legend>';
	echo $this->Form->input('JobCategory',array(
	            'label' => false,
	            'type' => 'select',
	            'multiple' => 'checkbox',
	            'options' => $jobCategories,
	            'selected' => $this->Html->value('JobCategory.JobCategory'),
		    ));
	echo '</fieldset>';
	echo $this->Form->end(array('id' => 'searchSubmit'));
?>
<div id = "searchResult">

</div>

<script type="text/javascript">
	$(function(){
		var count = 0;
		$('#parentJobLocation').live('change',function(event){
			var company = $(this).attr('value');
			$('#newRow0').remove();
			$('#JobProviderJobLocationId').attr('value',company);
			if(company != ''){
				count = 1;
				$(this).closest('div').append('<div id="newRow0"></div>');	
				$('#newRow0').load(__HOST_NAME__ + '/job_locations/get_location/' + company + '/' + 1,function(){});
			}
		});
	});
</script>